<?php
/* @var $this NewsController */
/* @var $model News */

$this->breadcrumbs=array(
	'News'=>array('index'),
	'Create',
);

$this->menu=array(
	array('label'=>'List News', 'url'=>array('index')),
	array('label'=>'Manage News', 'url'=>array('admin')),
);
?>
<div id="loader" style="text-align:center;">
	<span id="progress"><b>0%</b></span>
</div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script>
	<?php
	$pro = 0;
	for($i=0;$i<sizeof($size);$i++){
		for($j=0;$j<sizeof($size[$i]);$j++){
			for($k=0;$k<$size[$i][$j];$k++){
				
				?>
				$.get('index.php?r=news/get&source=<?php echo $i;?>&rss=<?php echo $j;?>&item=<?php echo $k;?>').success(function(){
					<?php $pro++; ?>
					$("#progress").remove();
					$('#loader').append('<span id="progress"><b><?php echo round($pro/($size[$i][$j])*100);?>%</b></span>');
				});
				<?php
			}
		}
	}
	?>
	/*setTimeout(function(){
	$('#loader').hide();
	},30000);*/
</script>
<!--
<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
